<?php

use Faker\Factory;
use Illuminate\Database\Seeder;
use App\System\Sales\Model\SalesUserInfo;

class SalesUserInfoTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run(SalesUserInfo $salesUserInfo)
    {
        //先清空表
        $salesUserInfo->truncate();
        //实例化faker类
        $faker = Factory::create('zh_CN');//生成中文数据
        //循环
        for ($i = 1; $i <= 30; $i++) {
            $salesUserInfo->insert([
                'user_id'     => $i,
                'type'        => mt_rand(1, 3),
                'referrer_id' => rand(1, 30),
                'created_at'  => date('Y-m-' . rand(1, 30) . ' H:i:s'),
            ]);
        }

    }
}
